/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.zhaojiu.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import me.zhengjie.base.BaseEntity;

import javax.persistence.*;
import javax.validation.constraints.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @website https://el-admin.vip
* @description /
* @author Jiayin Wei
* @date 2021-12-09
**/
@Entity
@Data
@Table(name="zj_teacher")
public class Teacher extends BaseEntity implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "teacher_id")
    @ApiModelProperty(value = "ID")
    private Long teacherId;

    @Column(name = "name",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "姓名")
    private String name;

    @Column(name = "user_id")
    @ApiModelProperty(value = "用户ID")
    private Long userId;

    @Column(name = "gender_id")
    @ApiModelProperty(value = "性别ID")
    private Long genderId;

    @Column(name = "nation_id")
    @ApiModelProperty(value = "民族ID")
    private Long nationId;

    @Column(name = "photo_url")
    @ApiModelProperty(value = "照片真实路径")
    private String photoUrl;

    @Column(name = "work_unit")
    @ApiModelProperty(value = "工作单位")
    private String workUnit;

    @Column(name = "birth_date")
    @ApiModelProperty(value = "出生年月")
    private Timestamp birthDate;

    @Column(name = "political_id")
    @ApiModelProperty(value = "政治面貌ID")
    private Long politicalId;

    @Column(name = "educational_id")
    @ApiModelProperty(value = "学历层次ID")
    private Long educationalId;

    @Column(name = "degree")
    @ApiModelProperty(value = "学位")
    private String degree;

    @Column(name = "major")
    @ApiModelProperty(value = "专业")
    private String major;

    @Column(name = "phone")
    @ApiModelProperty(value = "联系电话")
    private String phone;

    @Column(name = "id_card_no")
    @ApiModelProperty(value = "身份证号")
    private String idCardNo;

    @Column(name = "bank_no")
    @ApiModelProperty(value = "银行卡号")
    private String bankNo;

    @Column(name = "job")
    @ApiModelProperty(value = "现任职务")
    private String job;

    @Column(name = "postitional")
    @ApiModelProperty(value = "专业技术职称")
    private String postitional;

    @Column(name = "subjects")
    @ApiModelProperty(value = "可承担教学科目")
    private String subjects;

    @Column(name = "remark")
    @ApiModelProperty(value = "备注")
    private String remark;

    @Column(name = "enabled")
    @ApiModelProperty(value = "状态")
    private Boolean enabled;

    public void copy(Teacher source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
